import request from "network/request";

export const findBrand = (limit = 6) => {
  return request('home/brand', 'get', {
    limit
  })
}
export const findBanner = () => {
  return request('home/banner', 'get')
}
export const findNew = () => {
  return request('home/new', 'get')
}
export const findHot = () => {
  return request('home/hot', 'get')
}
export const findGoods = () => {
  return request('home/goods', 'get')
}
export const findSpecial = () => {
  return request('home/special', 'get')
}
/**
 * 获取单个顶级分类信息
 * @param {String} id - 顶级分类ID
 */
export const findTopCategory = (id) => {
  return request('/category', 'get', {
    id
  })
}

/**
 * 筛选数据
 * 二级类目
 */
export const findSubCategoryFilter = (id) => {
  return request('/category/sub/filter', 'get', {
    id
  })
}

/**
 * 获取分类下的商品（带筛选条件）
 * @param {Object} params - 可参考接口文档
 */
 export const findSubCategoryGoods = (params) => {
  return request('/category/goods/temporary', 'post', params)
}
